package com.recsmile.rpc.provider;

import java.lang.reflect.Proxy;

/**
 * Created by Administrator on 2016/8/3.
 */
public class MessageSendExecutor {

    public MessageSendExecutor(String serverAddress){
        RpcServerLoader.instance().load(serverAddress);
    }
    public void stop(){
        RpcServerLoader.instance().unload();
    }

    public <T> T newInstance(Class<T> cls){
        return (T) Proxy.newProxyInstance(cls.getClassLoader(), new Class[]{cls}, new MessageSendProxy());
    }
}
